class InfoController < ApplicationController 
    def leftTreeview_info

      parent_id = params[:parent_id]
      
      if parent_id=='root'
        root = Langzheng.new
        root.id=-1
        root.created_at=Time.now
        root.updated_at=Time.now
        root.is_directory=true
        root.file_name = '个人文件'
        root.file_change_time=Time.now
        root.user_id=1
        root.file_size=0
        root.parent_id=-100
        root.file_access_time=Time.now
        root.extend_name=''
        rootlist = Array.new
        rootlist.push(root)
        respond_to do |format|
           format.js { render_json rootlist.to_json }
        end
      else
        is_directory = params[:is_directory]
        @files = Langzheng.findinfo parent_id,is_directory
        respond_to do |format|
           format.js { render_json @files.to_json }
        end    
      end  
    
    end

end
